/**
 * @author loongnoy
 * @version 1.0
 * @created 11-3��-2025 14:36:48
 */
public class ChartFactory {
    // 图表工厂类，用于创建不同类型的图表对象

    public ChartFactory(){
        // 构造函数，初始化ChartFactory对象
    }

    public static Chart getChart(String type){
        // 根据传入的类型字符串，返回相应的图表对象
        Chart chart = null;
        if(type.equals("lineChart")){
            chart = new LineChart();
        } else if (type.equals("pieChart")) {
            chart = new PieChart();
        } else if (type.equals("histogramChart")) {
            chart = new HistogramChart();
        }
        return chart;
    }
}
